package controllers;

import java.util.List;

import models.domain.Contract;
import models.domain.ContractItem;
import play.*;
import play.db.jpa.Transactional;
import play.mvc.*;
import controllers.service.*;
import views.html.contracts.*;

public class Contracts extends Controller {

	@Transactional
	public static Result index() {
		
		String username = session("connected");
		
		CustomerService service = new CustomerService();
		
		List<Contract> contracts = service.getContracts(username);
		
		return ok(index.render(contracts));
	}
	
}